import {v4 as uuidv4} from 'uuid';
//生成随机字符串，每次执行不能变化，游客身份持久存储
export const getUUID = () => {
    //先从本第存储获取uuid
    let uuid_token =sessionStorage.getItem('UUIDTOKEN');
    //如果没有生成
    //生成游客零时身份
    if(!uuid_token){
        uuid_token = uuidv4();
        sessionStorage.setItem('UUIDTOKEN', uuid_token);
    }
    return uuid_token
}
